package org.zht.dormpro.auth.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.zht.dormpro.auth.model.SysRolePermission;

import java.util.List;

public interface SysRolePermissionMapper {
    @Delete({"delete from sys_role_permission","where id = #{id,jdbcType=INTEGER}"})
    int deleteByPrimaryKey(Integer id);

    int insertSelective(SysRolePermission record);

    @Select({"select",
        "id, sys_role_id, sys_permission_id, available, create_time, modify_time, creator, ",
        "mender",
        "from sys_role_permission",
        "where id = #{id,jdbcType=INTEGER}"})
    @ResultMap("org.zht.dormpro.auth.mapper.SysRolePermissionMapper.BaseResultMap")
    SysRolePermission selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(SysRolePermission record);

    int deleteMenuPerRL(@Param("id") Integer id,@Param("mrStatus") String mrStatus);

    List<SysRolePermission> getPermissionRoleRL(@Param("id") Integer id,@Param("mrStatus") String mrStatus);
}